package com.ruoyi.user.domain.bo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.common.core.validate.AddGroup;
import com.ruoyi.common.core.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 家庭成员业务对象 user_family
 *
 * @author strongme
 * @date 2023-01-26
 */

@Data
@EqualsAndHashCode(callSuper = true)
public class UserFamilyBo extends BaseEntity {

    /**
     * 主键
     */
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    private Long familyId;

    /**
     * 人员id
     */
    @NotNull(message = "人员id不能为空", groups = {AddGroup.class, EditGroup.class})
    private Long userId;

    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空", groups = {AddGroup.class, EditGroup.class})
    private String name;

    /**
     * 身份证
     */
    @NotBlank(message = "身份证不能为空", groups = {AddGroup.class, EditGroup.class})
    private String idno;

    /**
     * 性别
     */
    @NotBlank(message = "性别不能为空", groups = {AddGroup.class, EditGroup.class})
    private String gender;

    /**
     * 出生日期
     */
    @NotNull(message = "出生日期不能为空", groups = {AddGroup.class, EditGroup.class})
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    /**
     * 文化程度
     */
    @NotBlank(message = "文化程度不能为空", groups = {AddGroup.class, EditGroup.class})
    private String whcd;

    /**
     * 家庭地址
     */
    @NotBlank(message = "家庭地址不能为空", groups = {AddGroup.class, EditGroup.class})
    private String jtdz;

    /**
     * 单位与职业
     */
    @NotBlank(message = "单位与职业不能为空", groups = {AddGroup.class, EditGroup.class})
    private String dwyzy;

    /**
     * 相互关系
     */
    @NotBlank(message = "相互关系不能为空", groups = {AddGroup.class, EditGroup.class})
    private String xhgx;

    /**
     * 联系电话
     */
    @NotBlank(message = "联系电话不能为空", groups = {AddGroup.class, EditGroup.class})
    private String lxdh;


}
